<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>权重叠加比较层叠性</title>
    <style>
        /* (0,0,2,1) */
        .c1.c2 div {
            color: blue;
        }

        /* (0,1,0,1) */
        div #box3 {
            color: green;
        }

        /* (0,1,0,1) */
        /* 这个并不是继承,他是后代选择器,但与前面权重一致,后面CSS的继承性 */
        #box1 div {
            color: yellow;
        }
    </style>
</head>
<body>
    <div id="box1" class="c1">
        <div id="box2" class="c2">
            <div id="box3" class="c3"></div>
        </div>
    </div>

</body>
</html>